
//
//  QBEmoticonButton+Extension.swift
//  04-表情键盘
//
//  Created by bing on 16/4/2.
//  Copyright © 2016年 bing. All rights reserved.
//

import UIKit

class QBEmoticonButton: UIButton {
    
    var emoticon: QBEmoticonModel? {
        didSet {
            if emoticon!.emoji != nil {// emoji表情
                // 设置emoji
                setTitle(emoticon!.emoji, forState: UIControlState.Normal)
                setImage(nil, forState: UIControlState.Normal)
            } else {
                // 图片表情
                setTitle(nil, forState: UIControlState.Normal)
                // 设置图片
                setImage(UIImage(named: emoticon!.fullPngPath!), forState: UIControlState.Normal)
            }
        }
    }
}
